#include "consts.h"


typedef int paper_id_t;
typedef int count_t;

struct block_request_t {
  int paper_id;
  int block_id;
};

struct block_t {
  char data[BLOCK_SIZE];
  int size;
  int last;
  int paper_id;
  int error;
  char error_message[MAX_ERROR_MESSAGE_LENGTH];
};

struct error_info_t {
  int error;
  char error_message[MAX_ERROR_MESSAGE_LENGTH];
};

struct paper_info_t {
  char author[MAX_AUTHOR_LENGTH];
  char title[MAX_TITLE_LENGTH]; 
  char file_name[MAX_FILE_NAME_LENGTH];
  int next_paper_id;
  int error;
  char error_message[MAX_ERROR_MESSAGE_LENGTH];
};



program PAPER_PROG {
   version FIRST_VERS {
     paper_id_t paper_add(paper_info_t) = 10;
     paper_info_t get_paper(paper_id_t) = 11;
     block_t get_block(block_request_t) = 12;
     error_info_t add_block(block_t) = 13;

   } = 1;                          /* Version number = 1 */
} = 0x3543000;                     /* Program number = 0x3543000 */

